#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Dependency.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class DeployedArtifact;
class DeploymentSpecification;
class DeploymentTarget;

/// <summary>
/// Deployment
/// A deployment is the allocation of an artifact or artifact instance to a
/// deployment target.
/// A component deployment is the deployment of one or more
/// artifacts or artifact instances to a deployment target, optionally parameterized
/// by a deployment specification. Examples are executables and configuration files.
/// </summary>
class UMLMODEL_EXPORT Deployment : public Dependency {

public: // Constructors and destructors
    explicit Deployment(const QString& umlType="uml::Deployment");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// configurations getter
    /// The specification of properties that parameterize the deployment and execution
    /// of one or more Artifacts.
    /// </summary>
    vector<shared_ptr<DeploymentSpecification>>& configurations();

    /// <summary>
    /// deployedArtifacts getter
    /// The Artifacts that are deployed onto a Node. This association specializes the
    /// supplier association.
    /// </summary>
    vector<shared_ptr<DeployedArtifact>>& deployedArtifacts();

    /// <summary>
    /// location getter
    /// The DeployedTarget which is the target of a Deployment.
    /// </summary>
    shared_ptr<DeploymentTarget> location() const;

    /// <summary>
    /// location setter
    /// The DeployedTarget which is the target of a Deployment.
    /// </summary>
    void setLocation(shared_ptr<DeploymentTarget> value);

private: // Fields
    /// <summary>
    /// configurations
    /// The specification of properties that parameterize the deployment and execution
    /// of one or more Artifacts.
    /// </summary>
    vector<shared_ptr<DeploymentSpecification>> configurations_;

    /// <summary>
    /// deployedArtifacts
    /// The Artifacts that are deployed onto a Node. This association specializes the
    /// supplier association.
    /// </summary>
    vector<shared_ptr<DeployedArtifact>> deployedArtifacts_;

    /// <summary>
    /// location
    /// The DeployedTarget which is the target of a Deployment.
    /// </summary>
    shared_ptr<DeploymentTarget> location_;

};

} // namespace uml
